package com.firexxx.study.designmodel.sixconcept.requirement.origin;

/**
 * @description: 折扣
 * @author: zhuangzhang2
 * @date: 2021-01-04 15:43
 */
public class DiscountService {

    public int discount(int price) {
        if (price < 0) {
            throw new IllegalArgumentException();
        }

        return (int) (price * 0.5);
    }

}
